import React from 'react'
import store, { changeTextAction } from '../../redux/store'
export default function Index() {


  const changeText = (e) => {
    // 修改的时候 ，修改reduer里的值；
    store.dispatch(changeTextAction(e.target.value));
    console.log("??", store.getState().val);
  }


  return (
    <div>
      <h1 className='title'>ToDoList</h1>
      <input type="text" value={store.getState().val} onChange={changeText} className='myinput' placeholder='请输入需要做的任务，按enter按键添加' />
    </div>
  )
}
